package com.hzlj.position.locate.service;

import cn.hutool.core.map.MapUtil;
import com.hzlj.common.message.common.dto.message.MessageNoticeResultDTO;
import com.hzlj.position.locate.differentiation.sysCheck.traceCheck.cross.CrossSysCheck;
import com.hzlj.position.locate.differentiation.sysCheck.traceCheck.demount.DemountSysCheck;
import com.hzlj.position.locate.service.impl.ReportInitiativeServiceImpl;
import com.hzlj.position.locate.service.impl.ReportInspectionSyncServiceImpl;

import java.util.Date;
import java.util.Map;

/**
 * 当天消息通知(MessageToday)表服务接口
 *
 * @author makejava
 * @date 2024-01-10 16:38:24
 */
public interface MessageTemplateBussService {
    Map<String, Class<? extends MessageTemplateBussService>> classOfMessageTemplate = MapUtil.<String, Class<? extends MessageTemplateBussService>>builder()
            .put("report-initiative-complement", ReportInitiativeServiceImpl.class)
            .put("report-initiative-before", ReportInitiativeServiceImpl.class)
            .put("report-initiative-before-gzry", ReportInitiativeServiceImpl.class)
            .put("report-initiative-after-gzry", ReportInitiativeServiceImpl.class)
            .put("report-initiative-no-report-handle", ReportInitiativeServiceImpl.class)
            .put("report-inspection", ReportInspectionSyncServiceImpl.class)
            .put("report-inspection-before", ReportInspectionSyncServiceImpl.class)
            .put("report-inspection-before-gzry", ReportInspectionSyncServiceImpl.class)
            .put("report-inspection-after-gzry", ReportInspectionSyncServiceImpl.class)
            .put("report-inspection-no-report-handle", ReportInspectionSyncServiceImpl.class)
            //.put("report-inspection-track-check-abn-\\d+-gzry", ReportInspectionTrackCheckServiceImpl.class)
            //.put("report-inspection-track-check-normal-\\d+-gzry", ReportInspectionTrackCheckServiceImpl.class)
            .put("locate-sys-check-abn-2-gzry", CrossSysCheck.class)
            .put("locate-sys-check-normal-2-gzry", CrossSysCheck.class)
            .put("locate-sys-check-no-report-2-gzry", CrossSysCheck.class)
            .put("locate-sys-check-abn-4-gzry", DemountSysCheck.class)
            .put("locate-sys-check-normal-4-gzry", DemountSysCheck.class)
            .put("locate-sys-check-no-report-4-gzry", DemountSysCheck.class)
            .build();

    /**
     * 是否需要发送
     */
    default boolean checkNeedSend(String messageTemplate,
                                  String serviceId,
                                  Date belongDay,
                                  Map<String, Object> messageParams,
                                  Map<String, Object> checkParams) {
        return true;
    }

    /**
     * 修改发送结果
     */
    default void updateNoticeResult(String messageTemplate,
                                    String serviceId,
                                    Date belongDay,
                                    Map<String, Object> checkParams,
                                    MessageNoticeResultDTO notice) {
    }

}
